/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __CONFIG_CONFIG_H__
#define __CONFIG_CONFIG_H__

namespace xos_http
{

    class config
    {
    public:
        typedef std::list< std::string > STR_LIST;
    public:
        config();
        ~config();

    protected:
        int load( const char * lpszFile );
        int get_config();

    protected:
        // config obj
        xos_box::i_str_property * m_pLastConfigProp;
        xos_box::i_str_property * m_pConfigProp;
        xos_box::i_variant * m_pConfig;

    public:
        static config * get();
        static int init();
        static int term();

    public:
        // welcome
        STR_LIST m_welcome_file_list;

        // heart
        int heart_check_interval_ms;

        // params
        std::string db_connect_str;
        std::string m_listener;
        std::string m_servlet;
        std::string m_before;
        std::string m_after;

        // app path
        std::string m_hot_replace_xos;
        std::string m_default_host;
        std::string m_web_root;
        std::string m_filter;
        std::string m_root;
        std::string m_ssl;

        // file type
        std::string m_xos;
        std::string m_jsp;

    };

} // xos_http

#endif // __CONFIG_CONFIG_H__
